package com.csmall.order.webapi.mapper;

import com.csmall.commons.pojo.order.entity.Order;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Name: OrderMapper
 * @Author: 西风残叶
 * @Date: 2024/8/18 18:33
 * @Version: 1.0
 * @TODO: TODO
 */
@Repository
public interface OrderMapper {
    @Insert("insert into order_tbl(user_id,commodity_code,count,money) values" +
            "(#{userId},#{commodityCode},#{count},#{money})")
    int insertOrder(Order order);

    // 分页查询所有
    @Select("select id,user_id,commodity_code,count,money from order_tbl")
    List<Order> findAllOrders();
}